package year2019.month0234;

import org.junit.Test;

/**
 * @desc 描述
 * create on 2019/3/11 by watson
 */
public class FunctionTest {

    @Test
    public void funTest(){
        ATest tes = new ATest();
        tes.setName("小明");
        tes.setAge(10);
        fun(tes);
        System.out.println(tes);
    }

    public void fun(ATest tes){
        tes = new ATest();
        tes.setName("小花");
        tes.setAge(9);
        System.out.println(tes);
    }

}

class ATest{
    private String name;
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String toString(){
        return "name="+name+"&age="+age;
    }
}
